package com.in.mobilerechargedth;

import java.util.ArrayList;
import java.util.List;

import com.in.mobilerechargedth.constant.ConstantVariables;
import com.in.mobilerechargedth.model.CircleModel;

import android.os.Bundle;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class FifthCircleDetailScreenActivity extends BaseActivity {

    List<CircleModel> listCircleModel;
    int operatorId = 0;
    int circleId = 0;
    Button backbtn;
    TextView txtCircleContact, txtPhoneContact, txtEmailContact, txtTollFreeNumber;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fifth_circle_detail_screen);
        String strCircleId = getIntent().getStringExtra(ConstantVariables.CIRCLE_ID);
        circleId = Integer.parseInt(strCircleId);
        String strOperatorId = getIntent().getStringExtra(ConstantVariables.OPERATOR_ID);
        operatorId = Integer.parseInt(strOperatorId);
        listCircleModel = new ArrayList<CircleModel>();
        backbtn = (Button) findViewById(R.id.backbtn);
        backbtn.setVisibility(View.VISIBLE);
        backbtn.setOnClickListener(this);
        listCircleModel = FifthScreenActivity.listCircle;
        txtCircleContact = (TextView) findViewById(R.id.txtCircleContact);
        txtPhoneContact = (TextView) findViewById(R.id.txtPhoneContact);
        txtEmailContact = (TextView) findViewById(R.id.txtEmailContact);
        txtTollFreeNumber = (TextView) findViewById(R.id.txtTollFreeNumber);


        for (CircleModel circleModel : listCircleModel) {
            if (operatorId == circleModel.getOperatorId() && circleId == circleModel.getCircleId()) {
                txtCircleContact.setText(circleModel.getCircleName());
                txtPhoneContact.setText(circleModel.getPhoneNumber());
                txtEmailContact.setText(circleModel.getEmail());
                txtTollFreeNumber.setText(circleModel.getTollFreeNumber());

            }
        }

        setupAdmob();
        share();
    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
    }
    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        super.onClick(v);
        switch (v.getId()) {
        case R.id.backbtn:
            this.onBackPressed();
            break;
        }
    }
}
